package com.insigma.business.qrcode.soldier.dto;

import lombok.Data;

import java.io.Serializable;


@Data
public class LocationDTO implements Serializable {

    private static final long serialVersionUID = -3346463917952089547L;

    
    private String provinceName;
    private String provinceCode;
    private String provinceId;

    private String prefectureName;
    private String prefectureCode;
    private String prefectureId;

    
    private String cityName;
    private String cityCode;
    private String cityId;

    
    private String countyName;
    private String countyCode;
    private String countyId;

    
    private String townName;
    private String townCode;
    private String townId;

    
    private String villageName;
    private String villageCode;
    private String villageId;

    public void addByLevel(String name, Integer level) {
        switch (level) {
            case 1:
                provinceName = name;
                break;
            case 2:
                prefectureName = name;
                break;
            case 3:
                countyName = name;
                break;
            case 4:
                townName = name;
                break;
            case 5:
                villageName = name;
                break;
            default:
                ;

        }
    }

    public void addByLevel(String name, String code, String id, Integer level) {
        switch (level) {
            case 1:
                provinceName = name;
                provinceId = id;
                provinceCode = code;
                break;
            case 2:
                prefectureName = name;
                prefectureId = id;
                prefectureCode = code;

                cityName = name;
                cityId = id;
                cityCode = code;

                break;
            case 3:
                countyName = name;
                countyId = id;
                countyCode = code;
                break;
            case 4:
                townName = name;
                townId = id;
                townCode = code;
                break;
            case 5:
                villageName = name;
                villageId = id;
                villageCode = code;
                break;
            default:
                ;

        }
    }
}
